package cn.zxh.improvement.gencode.context;

import javax.annotation.processing.ProcessingEnvironment;

/**
 * 编译时环境的相关参数
 *
 * @author zxh
 * @since 2023/5/6 16:38:03
 */
public class ProcessingEnvironmentHolder {

    /**
     * 环境参数
     */
    public static final ThreadLocal<ProcessingEnvironment> ENVIRONMENT = new ThreadLocal<>();

    public static void setEnvironment(ProcessingEnvironment pe) {
        ENVIRONMENT.set(pe);
    }

    public static ProcessingEnvironment getEnvironment() {
        return ENVIRONMENT.get();
    }

    public static void removeEnvironment() {
        ENVIRONMENT.remove();
    }
}
